package com.lino.design.user.impl;

import com.lino.design.user.User;
import com.lino.design.visitor.Visitor;

import java.util.Random;

/**
 * @description: 学生类
 * @author: lingjian
 * @createDate: 2023/2/10 10:58
 */
public class Student extends User {

    public Student(String name, String identity, String clazz) {
        super(name, identity, clazz);
    }

    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    /**
     * 排名
     */
    public int ranking() {
        return (int) (Math.random() * 100);
    }

    /**
     * 数量
     */
    public int count() {
        return 105 - new Random().nextInt(10);
    }
}
